﻿using System;
using ZX.Web.UI.Controls;

namespace ZX.WebApp.forum
{
    public partial class forumPage : ListPage
    {

        public string GetUserInfo(object userID)
        {
            if (userID == null)
            {
                return "";
            }
            ZX.BLL.Extend.BaseBussnies bll = new ZX.BLL.Extend.BaseBussnies();
            System.Data.DataTable dt = bll.GetDataBySqlComm(string.Format(@"select hrEmployee.CName,DatPost.PostName,
substring(DatDepartment.LDeptName,Len(DatDepartment.LDeptName)-LEN('中旭股份->董事会'),Len(DatDepartment.LDeptName)) as DeptName from DatUser
left join  hrEmployee on DatUser.EmpID=hrEmployee.ID
LEFT Join DatPost on hrEmployee.PostID=DatPost.PostID
left join DatDepartment on hrEmployee.DepartmentID=DatDepartment.DeptID
where  UserID='{0}'
", userID));
            if (dt == null)
            {
                return "";
            }
            else
            {
                if (dt.Rows.Count > 0)
                {
                    return dt.Rows[0].ItemArray[0].ToString() + "(<font color='blue'>" + (dt.Rows[0].ItemArray[1] == null ? "" : dt.Rows[0].ItemArray[1].ToString()) + "</font>)";
                }
                return "";
            }
        }
    }
}